<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- React核心包 最先引入 提供一个对象React -->
    <script src="../react18/react.development.js"></script>
    <!-- React操作DOM的包 提供了一个对象 ReactDOM -->
    <script src="../react18/react-dom.development.js"></script>
    <style>
        .outer{
            width: 400px;
            height: 300px;
            background-color: aqua;
        }
    </style>
</head>
<body>
    <div id="app"></div>
    <script>
    //创建虚拟DOM案例1
    //    const vDOM=React.createElement("div",{
    //         className:"outer"
    //     },"hello vDom");

    // 创建虚拟DOM案例2
    const vDOM =React.createElement("div",{
        className:"outer"
    },"hello vDom","hello world");


     
    // // 创建虚拟DOM案例3 createElement记住这个单词是这样写的
    //     const vDOM =React.createElement("div",{
    //         className:"outer"
    //     },React.createElement("h1",{},"React"),React.createElement("p",{},"React真让我们喜欢啊"));
        
        // 创建容器并渲染虚拟DOM
        ReactDOM.createRoot(document.getElementById("app")).render(vDOM)
    </script>
</body>
</html>